import pymysql
from utils import ERROR

def testMysqlConnect(ip: str, port: int, database: str, username: str, password: str):
    try:
        db = pymysql.connect(host= ip,
                             port = port,
                        user= username,
                        password=password,
                        database= database)
    except Exception as e:
        ERROR(e)
        return False
    db.close()
    return True